﻿using System;
using System.Collections.Generic;

namespace SurveySystem.Model
{
    /// <summary>
    /// Represents a response to a <see cref="Survey"/> in the system. Survey, <see cref="Question"/> and <see cref="Answer"/> define
    /// the survey, while Response and <see cref="ResponseAnswer"/> represent a response from a user
    /// </summary>
    public class Response
    {
        /// <summary>
        /// The ID field of this Response object
        /// </summary>
        public int ResponseID { get; set; }
        /// <summary>
        /// The ID field of the <see cref="Survey"/> object to which this response relates
        /// </summary>
        public int SurveyID { get; set; }
        /// <summary>
        /// A free-text field to represent a participant. May be used in future releases
        /// </summary>
        public string ParticipantID { get; set; }
        /// <summary>
        /// The time this response was generated (i.e. when the survey was taken)
        /// </summary>
        public DateTime ResponseTime { get; set; }
        /// <summary>
        /// Free text field to indicate the name of the machine (PC) this survey was taken on. May be used in future releases
        /// </summary>
        public string Machine { get; set; }
        /// <summary>
        /// A collection of <see cref="ResponseAnswer"/> object relating to this Response
        /// </summary>
        public List<ResponseAnswer> Answers { get; private set; }

        public Response()
        {
            ResponseID = -1;
            SurveyID = -1;
            ParticipantID = "";
            ResponseTime = DateTime.Now;
            Machine = "";
            Answers = new List<ResponseAnswer>();
        }
        
    }
}
